package com.atguigu.dao.impl;

import com.atguigu.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

/**
 * @Author: liuaojun
 * @CreateTime: 2025-01-17
 * @Description:
 * @Version: 1.0
 */
@Repository
public class UserDaoImpl implements UserDao {
    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Override
    public void UpdateUserPassword(String password,String username) {
        String sql = "update t_user set password=? where username=?";
        jdbcTemplate.update(sql,password,username);
    }

    @Override
    public void UpdateUserNickName(String nickname, String username) {
        String sql = "update t_user set nickname=? where username=?";
        jdbcTemplate.update(sql,nickname,username);
    }
}
